# 此脚本在本地电脑运行
import socket
import os
ip = "x.x.x.x" #此处填入你的服务器公网ip地址


def start_client(ip):
    c = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    c.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
    c.connect((ip,7777))
    print("Server Connected!")
    c.ioctl(socket.SIO_KEEPALIVE_VALS,(1,60*1000,30*1000))
    while True:
        c.send("Open".encode())
        data = c.recv(1024)
        print(data.decode())
        if(data.decode()=="Received!"):
            os.system('"xxxxxxxxxx"') #此处填入你要打开的软件路径。注意路径斜杠要用两个反斜杠\\或者是一个正斜杠/，不要忘记最外面的引号，以防路径中有空格



if __name__ == '__main__':
    start_client(ip)
